{% extends "base.html" %}
{% load my_filter %}
{% block title %}不同rssi的入店量、客流量{% endblock %}
{% block head_script_block %}
<script src="/js/zmwsdebug.js"></script>
{% endblock %}
{% block body_content_block %}
<div class="row-fluid">

    <div class="span12">
        <button class="btn" type="button" onclick="javascript:history.go(-1)">返回</button>
        {% if all_datas %}
        <table width="400%" border="1" cellpadding="2" cellspacing="0" id="customer_datas">
            <thead>
            <tr>
                <th rowspan="4">日期</th>

                <th colspan="100">rssi范围</th>
            </tr>

            <tr>
                {% for rssi in rssiList %}
                <th colspan="{{ walkby_time_list|length }}">{{ rssi }}</th>
               <!-- <th></th> -->
                {% endfor %}
            </tr>
            <tr>
                {% for rssi in rssiList %}
               <!-- <th rowspan="2">客流量(walkby=0)</th> -->
                <th colspan="{{ walkby_time_list|length }}">入店量</th>

                


                {% endfor %}
            </tr>
            <tr>
                {% for rssi in rssiList %}
                {% for walkby_time in walkby_time_list %}
                <th>{{ walkby_time }}秒</th>


                {% endfor %}

                {% endfor %}
            </tr>
            </thead>
            <tbody>
            {% for all_data in all_datas|dictsort:"day" %}
            <tr>
                <th>{{ all_data.day }}</th>
               <!-- <td>{{ rdatas.all_flow }}</td> -->
                {% for rssi,rdatas  in all_data.data.items|sort %}
                {% for walkby_time in walkby_time_list %}
                {% ifequal '0' walkby_time %}<td>{{ rdatas.all_customer.0 }}</td>{% endifequal %}
                {% ifequal '1' walkby_time %}<td>{{ rdatas.all_customer.1 }}</td>{% endifequal %}
                {% ifequal '15' walkby_time %}<td>{{ rdatas.all_customer.15 }}</td>{% endifequal %}
                {% ifequal '30' walkby_time %}<td>{{ rdatas.all_customer.30 }}</td>{% endifequal %}
                {% ifequal '45' walkby_time %}<td>{{ rdatas.all_customer.45 }}</td>{% endifequal %}
                {% ifequal '60' walkby_time %}<td>{{ rdatas.all_customer.60 }}</td>{% endifequal %}
                {% ifequal '120' walkby_time %}<td>{{ rdatas.all_customer.120 }}</td>{% endifequal %}
                {% endfor %}
                

                {% endfor %}
            </tr>

            {% endfor %}
            </tbody>
        </table>
        {% endif %}
    </div>
</div>

<script>


    $(document).ready(function() {

        $('#customer_datas').dataTable( {


            "language":{
                'url':'/js/dataTables.language.chinese.json'
            },
            "columnDefs": [ {
                "visible": false,
                "targets": -1
            } ],
            "sDom": 'T<"clear">lfrtip',
            "tableTools": {
                "aButtons": [
                    {
                        "sExtends": "csv",
                        "oSelectorOpts": {
                            page: 'all'
                        },
                        "sButtonText": "导出CSV"

                    },
                    {
                        "sExtends": "xls",
                        "oSelectorOpts": {
                            page: 'all'
                        },
                        "sButtonText": "导出EXCEL"
                    }
                ]

            },
            "aLengthMenu":[[100],[100]]

        } );
    } );


    $('#id_startTime').datetimepicker({format: 'yyyy-mm-dd',
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0});
    $( ".target" ).change(function() {
        $("#button").click()
    });
    $('#id_endTime').datetimepicker({format: 'yyyy-mm-dd',
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0});


</script>

{% endblock %}

